package com.juyu.miliao.scheduler.dao.mysql;

import java.util.HashMap;
import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.juyu.miliao.common.dataSource.tool.distributeOperate.DistributeOperate;
import com.juyu.miliao.scheduler.domin.Withdrawals;

/**
 * @author pengs
 *
 */
@Repository
public class WithdrawalsDao {
	@Autowired
	private SqlSession sqlSession;

	/**
	 * @return
	 */
	@DistributeOperate(ds = "miliao-user")
	public List<Withdrawals> getWithdrawals() {
		return sqlSession.selectList("getWithdrawals");
	}

	/**
	 * @param list
	 */
	@DistributeOperate("strategy('byWithdrawals', #list)")
	public void addWithdrawals(List<Withdrawals> list) {
		HashMap<String, Object> params = new HashMap<>();
		params.put("list", list);
		sqlSession.insert("addWithdrawals",list);
	}

}
